```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>责任链设计模式：优雅地处理请求链</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 0.5rem;
            overflow-x: auto;
        }
        .drop-cap:first-letter {
            float: left;
            font-size: 3.5em;
            line-height: 0.85;
            margin-right: 0.1em;
            margin-top: 0.1em;
            color: #4f46e5;
            font-weight: bold;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6">责任链设计模式</h1>
            <p class="text-xl md:text-2xl opacity-90 mb-8">优雅地处理请求链</p>
            <div class="w-20 h-1 bg-white mx-auto mb-8"></div>
            <p class="text-lg md:text-xl max-w-3xl mx-auto opacity-90">将处理请求的对象组成一个链条，实现请求发送者和接收者的解耦，让多个对象都有机会处理请求。</p>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 py-12 md:py-16">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="drop-cap bg-white rounded-xl shadow-md p-8">
                <p class="text-lg leading-relaxed">责任链设计模式是一种行为型设计模式，它通过将处理请求的对象组成一个链条，每个对象都有机会处理请求或将其传递给下一个对象。这种模式将请求发送者和接收者解耦，使得多个对象都有机会处理请求，同时也可以动态地构建处理链。</p>
            </div>
        </section>

        <!-- Features Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-star text-purple-600 mr-3"></i>
                模式特点
            </h2>
            <div class="grid md:grid-cols-2 gap-6">
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-purple-600 text-2xl mb-3">
                        <i class="fas fa-link"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">解耦职责</h3>
                    <p class="text-gray-600">责任链模式将请求的发送者和接收者解耦，发送者无需知道请求最终由哪个对象处理。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-purple-600 text-2xl mb-3">
                        <i class="fas fa-random"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">动态链</h3>
                    <p class="text-gray-600">责任链可以在运行时动态地构建，灵活适应不同的请求处理流程。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-purple-600 text-2xl mb-3">
                        <i class="fas fa-expand"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">可拓展性</h3>
                    <p class="text-gray-600">可以方便地添加新的处理对象到责任链中，扩展性强。</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-purple-600 text-2xl mb-3">
                        <i class="fas fa-list-ol"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-2">遍历链</h3>
                    <p class="text-gray-600">责任链模式可以按顺序遍历处理链，每个对象都有机会处理请求。</p>
                </div>
            </div>
        </section>

        <!-- Use Cases -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-lightbulb text-purple-600 mr-3"></i>
                使用场景
            </h2>
            <div class="bg-white rounded-xl shadow-md p-8">
                <div class="mb-6">
                    <h3 class="text-xl font-semibold mb-3 text-purple-600">1. 请求需要经过多个处理步骤</h3>
                    <p class="text-gray-600">当请求需要经过多个对象处理时，可以使用责任链模式，每个对象负责一步处理。</p>
                </div>
                <div>
                    <h3 class="text-xl font-semibold mb-3 text-purple-600">2. 请求发送者与接收者解耦</h3>
                    <p class="text-gray-600">当发送者和接收者之间需要解耦，使得它们不直接依赖于彼此时，可以使用责任链模式。</p>
                </div>
            </div>
        </section>

        <!-- Framework Example -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-cogs text-purple-600 mr-3"></i>
                框架应用示例
            </h2>
            <div class="bg-white rounded-xl shadow-md p-8">
                <h3 class="text-xl font-semibold mb-4 text-gray-700">Java Servlet过滤器链</h3>
                <p class="text-gray-600 mb-6">在Java Web开发中，Servlet过滤器就是一个典型的责任链模式的应用。多个过滤器依次处理请求，每个过滤器都可以决定是否将请求传递给下一个过滤器或终止处理。</p>
                <div class="bg-gray-100 rounded-lg p-4">
                    <img src="https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/filters/filtersArch.jpg" alt="Servlet过滤器链示意图" class="rounded-lg mx-auto">
                </div>
            </div>
        </section>

        <!-- Visualization -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-project-diagram text-purple-600 mr-3"></i>
                模式结构图
            </h2>
            <div class="bg-white rounded-xl shadow-md p-8">
                <div class="mermaid">
                    classDiagram
                        class Client
                        class Handler {
                            <<abstract>>
                            +successor: Handler
                            +setSuccessor(Handler)
                            +handleRequest(Request)
                        }
                        class ConcreteHandler1 {
                            +handleRequest(Request)
                        }
                        class ConcreteHandler2 {
                            +handleRequest(Request)
                        }
                        class Request

                        Client --> Handler
                        Handler <|-- ConcreteHandler1
                        Handler <|-- ConcreteHandler2
                        ConcreteHandler1 --> Handler: successor
                        ConcreteHandler2 --> Handler: successor
                        Handler ..> Request
                </div>
            </div>
        </section>

        <!-- Code Example -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 flex items-center">
                <i class="fas fa-code text-purple-600 mr-3"></i>
                实现示例
            </h2>
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="bg-gray-800 text-white px-4 py-3 flex items-center">
                    <div class="flex space-x-2 mr-4">
                        <div class="w-3 h-3 rounded-full bg-red-500"></div>
                        <div class="w-3 h-3 rounded-full bg-yellow-500"></div>
                        <div class="w-3 h-3 rounded-full bg-green-500"></div>
                    </div>
                    <span>LeaveApprovalSystem.java</span>
                </div>
                <div class="code-block p-6 text-sm">
                    <pre><code class="language-java">abstract class Approver {
    protected Approver successor;

    public void setSuccessor(Approver successor) {
        this.successor = successor;
    }

    public abstract void processRequest(LeaveRequest request);
}

class Manager extends Approver {
    @Override
    public void processRequest(LeaveRequest request) {
        if (request.getDays() <= 2) {
            System.out.println("Manager approved the leave request for " + request.getDays() + " days.");
        } else if (successor != null) {
            successor.processRequest(request);
        }
    }
}

class Director extends Approver {
    @Override
    public void processRequest(LeaveRequest request) {
        if (request.getDays() > 2 && request.getDays() <= 5) {
            System.out.println("Director approved the leave request for " + request.getDays() + " days.");
        } else if (successor != null) {
            successor.processRequest(request);
        }
    }
}

class CEO extends Approver {
    @Override
    public void processRequest(LeaveRequest request) {
        if (request.getDays() > 5) {
            System.out.println("CEO approved the leave request for " + request.getDays() + " days.");
        } else if (successor != null) {
            successor.processRequest(request);
        }
    }
}

class LeaveRequest {
    private int days;

    public LeaveRequest(int days) {
        this.days = days;
    }

    public int getDays() {
        return days;
    }
}

public class ChainOfResponsibilityDemo {
    public static void main(String[] args) {
        Approver manager = new Manager();
        Approver director = new Director();
        Approver ceo = new CEO();

        manager.setSuccessor(director);
        director.setSuccessor(ceo);

        LeaveRequest request1 = new LeaveRequest(1);
        LeaveRequest request3 = new LeaveRequest(3);
        LeaveRequest request7 = new LeaveRequest(7);

        manager.processRequest(request1);
        manager.processRequest(request3);
        manager.processRequest(request7);
    }
}</code></pre>
                </div>
            </div>
            <div class="mt-6 bg-blue-50 rounded-lg p-6">
                <div class="flex items-start">
                    <div class="flex-shrink-0 text-blue-500 text-xl mr-3 mt-1">
                        <i class="fas fa-info-circle"></i>
                    </div>
                    <div>
                        <h4 class="font-semibold text-blue-800 mb-2">代码说明</h4>
                        <p class="text-blue-700">在上面的示例中，不同级别的请假申请会依次被经理、总监和CEO处理。如果某个级别的处理者无法处理请求，它会将请求传递给下一个处理者。</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Summary -->
        <section class="mb-16">
            <div class="bg-purple-50 rounded-xl p-8 border-l-4 border-purple-600">
                <h2 class="text-2xl font-bold mb-4 text-purple-800">总结</h2>
                <p class="text-purple-700">责任链设计模式能够使得请求的处理流程更加灵活，降低代码的耦合度，使得系统更易于扩展和维护。通过将多个处理对象连接成一条链，请求会沿着这条链传递，直到有一个对象处理它为止，这为处理流程提供了极大的灵活性。</p>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto max-w-5xl px-4 text-center">
            <div class="mb-4">
                <h3 class="text-lg font-semibold mb-2">技术小馆</h3>
                <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition-colors duration-300">http://www.yuque.com/jtostring</a>
            </div>
            <div class="text-gray-400 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            fontFamily: "'Noto Sans SC', sans-serif",
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```